feat(vue-router): upgrade to vue-router 5#31117
Conversation
…istory, and view stacks
…o feat/vue-router-upgrade
…o feat/vue-router-upgrade
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
561f950 to
3f69ec4
Compare
|
Nice, Will it work with |
| shell: bash | ||
| working-directory: ./packages/vue/test/build/${{ inputs.app }} | ||
| - name: 📦 Install Playwright Browsers | ||
| run: npx playwright install chromium |
There was a problem hiding this comment.
Why Chromium? The Angular tests don't pass in a browser.
There was a problem hiding this comment.
The Angular tests actually still only run Chromium despite downloading all 3 browsers. Both the vue tests and react tests only download the browser they use. It could be worth maybe adding support for running all 3 browsers in the future, but I think most of those issues are caught in core.
There was a problem hiding this comment.
If that's the case, can you either make a new PR or in this one to update the other frameworks to only use chromium. No need to inconsistent.
@reslear Hey, thanks! We don't test |
thetaPC
left a comment
There was a problem hiding this comment.
LGTM, thank you!
All my comments are suggestions and not blockers. I found no issues during the manual testing.
There was a problem hiding this comment.
We might want to consider making a global file for the packages. That way all the frameworks are consistent with their testing. We can always override them per framework as needed.
There was a problem hiding this comment.
Yeah, that's probably a good idea, but outside of the scope of this PR for sure
| ) { | ||
| (window as any).__ionSawInvisible = true; | ||
| } | ||
| if (m.type === 'childList') { |
There was a problem hiding this comment.
It can be beneficial to check if __ionSawInvisible is already true. I don't see the need to check the children if that's the case.
| if (m.type === 'childList') { | |
| if (!(window as any).__ionSawInvisible && m.type === 'childList') { |
| export async function waitForAnimationsComplete(page: Page, selector: string): Promise<void> { | ||
| await page.evaluate(async (sel: string) => { | ||
| const el = document.querySelector(sel); | ||
| if (!el) return; |
There was a problem hiding this comment.
This function doesn't throw an error like the other 2. Is that intentional? It could be helpful to know that the element didn't exist.
| * Ports the unit tests in packages/vue-router/__tests__/locationHistory.spec.ts | ||
| * to user-observable Playwright scenarios. Each describe block corresponds to | ||
| * one Jest case so the mapping is auditable when removing the Jest suite. | ||
| * |
There was a problem hiding this comment.
Not sure if we need this commented into the code. A comment on GitHub should be enough to let the reviewer know what changed.
| * Ports the unit tests in packages/vue-router/__tests__/locationHistory.spec.ts | |
| * to user-observable Playwright scenarios. Each describe block corresponds to | |
| * one Jest case so the mapping is auditable when removing the Jest suite. | |
| * |
There was a problem hiding this comment.
This was mostly for the future if I left the Jest tests in. I ultimately did not.
f898584
| */ | ||
|
|
||
| test.describe('Location History', () => { | ||
| // Maps to: 'should correctly add an item to location history' |
There was a problem hiding this comment.
Related to my comment above. These comments can be left in GitHub but doesn't seem beneficial to keep in code.
| name: 'Mobile Chrome', | ||
| use: { | ||
| browserName: 'chromium', | ||
| ...devices['Pixel 5'], |
There was a problem hiding this comment.
Why is this one testing a phone while Angular tests a desktop?
There was a problem hiding this comment.
Swipe-to-go-back is iOS-only and only fires on a touch viewport, so the gesture tests need a phone device profile. The Angular suite doesn't exercise gestures, so a desktop chrome viewport is fine there.
There was a problem hiding this comment.
It also doesn't make a lot of sense to me that we'd test on non-mobile views primarily considering most of our use case is mobile views
| shell: bash | ||
| working-directory: ./packages/vue/test/build/${{ inputs.app }} | ||
| - name: 📦 Install Playwright Browsers | ||
| run: npx playwright install chromium |
There was a problem hiding this comment.
If that's the case, can you either make a new PR or in this one to update the other frameworks to only use chromium. No need to inconsistent.
There was a problem hiding this comment.
Please mention how to use this in the Vue testing docs. Either in this PR or a new one, also add it for React Router.
There was a problem hiding this comment.
Any chance we can get the mode switch like in React?
brandyscarney
left a comment
There was a problem hiding this comment.
I found some issues while testing that I left as a comment on Jira. Great updates otherwise!
|
|
||
| The `@ionic/vue-router` package now requires Vue Router v5. Vue Router v4 is no longer supported. Vue Router v5 also raises its peer requirement on Vue itself, so the minimum supported Vue version moves to `3.5.0`. | ||
|
|
||
| **Minimum Version Requirements** |
There was a problem hiding this comment.
Can we also open a PR to update this on the docs site: https://ionicframework.com/docs/reference/support#ionic-vue
Side note: we should probably add columns for the supported router version as well.
There was a problem hiding this comment.
There was a problem hiding this comment.
I meant add it to the support table here: https://github.com/ionic-team/ionic-docs/blob/1c612e718a370241cdb92ef0f1a0bc6e2e1480fa/docs/reference/support.md?plain=1#L75-L82
Issue number: internal
What is the current behavior?
@ionic/vue-routerand@ionic/vuebuild against vue-router 4What is the new behavior?
Bumps
vue-routerto^5.0.6andvueto^3.5.0(vue-router 5 raises its peer to^3.5.0). We also added Playwright tests for Vue router that are in full parity with the previous Jest and removed the Jest tests and replaced them with Playwright.This PR also makes the current Vue test app, which is also used for the Vue Router automated tests, get rebuilt with the current PR version for testing in the Vercel preview links.
Does this introduce a breaking change?
Consumer apps that pin
vue-routerthemselves need to upgrade to^5.0.0, and apps that explicitly pinvueneed to bump to^3.5.0Other information
CI changes: CI no longer runs
npm run test.spec(the script and Jest devDeps are gone), and now runs playwright testsPreview (Vue + Vue Router test app, demos both packages from this PR):
https://ionic-framework-git-feat-vue-router-upgrade-ionic1.vercel.app/vue/